function firstPage1(){
    var form = document.getElementById('form');
    document.getElementById("pageNum1").value = "1";
    form.submit();
}
function lastPage1(){
    var form = document.getElementById('form');
    document.getElementById("pageNum1").value = document.getElementById("totalPages1").value;
    form.submit();
}
function nextPage1(){
    var form = document.getElementById('form');
    var totalPages=document.getElementById("totalPages1");
    var pageNum=document.getElementById("pageNum1");
    pageNum.value=parseInt(pageNum.value)+1;
    document.getElementById("pageNum1").value=pageNum.value;
    if(pageNum.value>=totalPages.value)
        pageNum.value=totalPages.value;
    document.getElementById("pageNum1").value=pageNum.value;
    form.submit();
}
function prePage1(){
    var form = document.getElementById('form');
    var pageNum=document.getElementById("pageNum1");
    pageNum.value=pageNum.value-1;
    if(pageNum.value<=0)
        pageNum.value=1;

    document.getElementById("pageNum1").value=pageNum.value;
    form.submit();
}
function searchRiskPage(){
    var form = document.getElementById('form');
    var pageNum1=document.getElementById("searchPageNum1");
    var pageNum2=document.getElementById("searchPageNum2");
    var pageNum3=document.getElementById("searchPageNum3");
    var totalPages1=document.getElementById("totalPages1").value;
    var totalPages2=document.getElementById("totalPages2").value;
    var totalPages3=document.getElementById("totalPages3").value;

    if (pageNum1.value>totalPages1)
        pageNum1.value=totalPages1;
    if(pageNum1.value<=0)
        pageNum1.value=1;
    document.getElementById("pageNum1").value=pageNum1.value;
    if (pageNum2.value>totalPages2)
        pageNum2.value=totalPages2;
    if(pageNum2.value<=0)
        pageNum2.value=1;
    document.getElementById("pageNum2").value=pageNum2.value;
    if (pageNum3.value>totalPages3)
        pageNum3.value=totalPages3;
    if(pageNum3.value<=0)
        pageNum3.value=1;
    document.getElementById("pageNum3").value=pageNum3.value;

    form.submit();
}
function firstPage2(){
    var form = document.getElementById('form');
    document.getElementById("pageNum2").value = "1";
    form.submit();
}
function lastPage2(){
    var form = document.getElementById('form');
    document.getElementById("pageNum2").value = document.getElementById("totalPages2").value;
    form.submit();
}
function nextPage2(){
    var form = document.getElementById('form');
    var totalPages=document.getElementById("totalPages2");
    var pageNum=document.getElementById("pageNum2");
    pageNum.value=parseInt(pageNum.value)+1;
    document.getElementById("pageNum2").value=pageNum.value;
    if(pageNum.value>=totalPages.value)
        pageNum.value=totalPages.value;
    document.getElementById("pageNum2").value=pageNum.value;
    form.submit();
}
function prePage2(){
    var form = document.getElementById('form');
    var pageNum=document.getElementById("pageNum2");
    pageNum.value=pageNum.value-1;
    if(pageNum.value<=0)
        pageNum.value=1;

    document.getElementById("pageNum2").value=pageNum.value;
    form.submit();
}
function firstPage3(){
    var form = document.getElementById('form');
    document.getElementById("pageNum3").value = "1";
    form.submit();
}
function lastPage3(){
    var form = document.getElementById('form');
    document.getElementById("pageNum3").value = document.getElementById("totalPages3").value;
    form.submit();
}
function nextPage3(){
    var form = document.getElementById('form');
    var totalPages=document.getElementById("totalPages3");
    var pageNum=document.getElementById("pageNum3");
    pageNum.value=parseInt(pageNum.value)+1;
    document.getElementById("pageNum3").value=pageNum.value;
    if(pageNum.value>=totalPages.value)
        pageNum.value=totalPages.value;
    document.getElementById("pageNum3").value=pageNum.value;
    form.submit();
}
function prePage3(){
    var form = document.getElementById('form');
    var pageNum=document.getElementById("pageNum3");
    pageNum.value=pageNum.value-1;
    if(pageNum.value<=0)
        pageNum.value=1;

    document.getElementById("pageNum3").value=pageNum.value;
    form.submit();
}